package main

import "fmt"

func main() {

	//字符看成字节
	var a byte = 'a'
	var b byte = '0'

	fmt.Println("a=", a) //97
	fmt.Println("b=", b) //48

	//输出字符
	fmt.Printf("a=%c  b=%c\n", a, b) //a=a  b=0

	//错误演示
	//var c byte = '爱'
	//fmt.Printf("c=%c", c)//constant 29233 overflows byte

	//用一个能装的下的容器去装
	var d int = '爱'
	fmt.Printf("d= %c  d码值= %d\n", d, d)

	var c1 int = 22269
	fmt.Printf("c1=%c\n", c1) //c1=国

	var c2 = 10 + 'a'
	fmt.Println("c2=", c2) //c2= 107
}
